News All Tests
Current file: /home/estudydev/workspace/MSP09/web/news/tests/class.CourseCreateDialog.inc.php
Legend: executed not executed dead code

  Coverage
  Classes Methods Lines
Total
100.00 %100.00%
100.00% 1 / 1
0.00 %0.00%
0.00% 0 / 14
1.24 %1.24%
1.24% 2 / 161
 
CourseCreateDialog
100.00 %100.00%
100.00% 1 / 1
0.00 %0.00%
0.00% 0 / 14
0.62 %0.62%
0.62% 1 / 160
 public function CourseCreateDialog()
0.00 %0.00%
0.00% 0 / 1
0.00 %0.00%
0.00% 0 / 1
 public function createDialog($treeParentId = 0, $mni = false)
0.00 %0.00%
0.00% 0 / 1
0.00 %0.00%
0.00% 0 / 31
 public function printHead($treeParentId = 0)
0.00 %0.00%
0.00% 0 / 1
0.00 %0.00%
0.00% 0 / 6
 public function printNameRow()
0.00 %0.00%
0.00% 0 / 1
0.00 %0.00%
0.00% 0 / 6
 public function printShortNameRow($mni = false)
0.00 %0.00%
0.00% 0 / 1
0.00 %0.00%
0.00% 0 / 6
 public function printModulShortCutRow()
0.00 %0.00%
0.00% 0 / 1
0.00 %0.00%
0.00% 0 / 5
 public function printSemesterRow()
0.00 %0.00%
0.00% 0 / 1
0.00 %0.00%
0.00% 0 / 6
 public function printDozentRow($teachers)
0.00 %0.00%
0.00% 0 / 1
0.00 %0.00%
0.00% 0 / 10
 public function printFoot()
0.00 %0.00%
0.00% 0 / 1
0.00 %0.00%
0.00% 0 / 7
 public static function printModulShortCutSelectRow()
0.00 %0.00%
0.00% 0 / 1
0.00 %0.00%
0.00% 0 / 16
 public static function printModulTitelSelectRow()
0.00 %0.00%
0.00% 0 / 1
0.00 %0.00%
0.00% 0 / 20
 public function printMNIParameter()
0.00 %0.00%
0.00% 0 / 1
0.00 %0.00%
0.00% 0 / 2
 public static function getJavaScript()
0.00 %0.00%
0.00% 0 / 1
0.00 %0.00%
0.00% 0 / 39
 public static function printJavaScript()
0.00 %0.00%
0.00% 0 / 1
0.00 %0.00%
0.00% 0 / 4


       1                 : <?php                                                                                                                                                                                                                                                        
       2                 : /*--------------------------------------------------------------------------+                                                                                                                                                                                
       3                 : This file is part of eStudy.                                                                                                                                                                                                                                 
       4                 : courses/classes/class.CourseCreateDialog.php                                                                                                                                                                                                                 
       5                 : - Modulgruppe:  Veranstaltung                                                                                                                                                                                                                                
       6                 : - Beschreibung: Dialog zum Anlegen einer neuen Veranstaltung.                                                                                                                                                                                                
       7                 : - Version:      0.1, 04/12/03                                                                                                                                                                                                                                
       8                 : - Autor(en):    Timo Fuchs <timo.fuchs@mni.fh-giessen.de>                                                                                                                                                                                                    
       9                 : +---------------------------------------------------------------------------+                                                                                                                                                                                
      10                 : This program is free software; you can redistribute it and/or                                                                                                                                                                                                
      11                 : modify it under the terms of the GNU General Public License                                                                                                                                                                                                  
      12                 : as published by the Free Software Foundation; either version 2                                                                                                                                                                                               
      13                 : of the License, or any later version.                                                                                                                                                                                                                        
      14                 : +---------------------------------------------------------------------------+                                                                                                                                                                                
      15                 : This program is distributed in the hope that it will be useful,                                                                                                                                                                                              
      16                 : but WITHOUT ANY WARRANTY; without even the implied warranty of                                                                                                                                                                                               
      17                 : MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                                                                                                                                                                                
      18                 : GNU General Public License for more details.                                                                                                                                                                                                                 
      19                 : You should have received a copy of the GNU General Public License                                                                                                                                                                                            
      20                 : along with this program; if not, write to the Free Software                                                                                                                                                                                                  
      21                 : Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.                                                                                                                                                                                  
      22                 : +--------------------------------------------------------------------------*/                                                                                                                                                                                
      23                 : /**                                                                                                                                                                                                                                                          
      24                 :  * In dieser Datei wird die Klasse CourseCreateDialog implementiert.                                                                                                                                                                                         
      25                 :  * @package eStudy.Courses                                                                                                                                                                                                                                   
      26                 :  * @version 0.1, 04/12/03                                                                                                                                                                                                                                    
      27                 :  * @author Timo Fuchs <timo.fuchs@mni.fh-giessen.de>                                                                                                                                                                                                         
      28                 :  */                                                                                                                                                                                                                                                          
      29                 :                                                                                                                                                                                                                                                              
      30                 : /**Kontrollsteuerung für den Assistens Modus*/                                                                                                                                                                                                              
      31               1 : require_once ("class.assistControll.inc.php");                                                                                                                                                                                                               
      32                 :                                                                                                                                                                                                                                                              
      33                 : /**                                                                                                                                                                                                                                                          
      34                 :  * Repraesentiert eine Formularmaske zum Erstellen neuer Veranstaltungen.                                                                                                                                                                                    
      35                 :  * Beim Klicken des Abbrechenbuttons kommt man zurueck zur Veranstaltunguebersicht,                                                                                                                                                                          
      36                 :  * Beim Klicken des Erstellenbuttons wird das Skript createcourse.php mit den                                                                                                                                                                                
      37                 :  * Post-Parametern 'coursename' ( Name der Veranstaltung ),                                                                                                                                                                                                  
      38                 :  *                 'semester'   ( gewaehltes Semester ),                                                                                                                                                                                                     
      39                 :  *                 'dozentID'   ( userid des Dozenten )    augerufen.                                                                                                                                                                                        
      40                 :  *                                                                                                                                                                                                                                                           
      41                 :  * @package  eStudy.Courses                                                                                                                                                                                                                                  
      42                 :  * @author   Timo Fuchs <timo.fuchs@mni.fh-giessen.de>                                                                                                                                                                                                       
      43                 :  * @version  0.1, 04/12/03                                                                                                                                                                                                                                   
      44                 :  */                                                                                                                                                                                                                                                          
      45               1 : class CourseCreateDialog {                                                                                                                                                                                                                                   
      46                 :                                                                                                                                                                                                                                                              
      47                 :                                                                                                                                                                                                                                                              
      48                 :     //Konstruktor.                                                                                                                                                                                                                                           
      49                 :     function CourseCreateDialog() {                                                                                                                                                                                                                          
      50                 :                                                                                                                                                                                                                                                              
      51               0 :     }                                                                                                                                                                                                                                                        
      52                 :                                                                                                                                                                                                                                                              
      53                 :      /** Erzeugt komplette Tabelle als Dialog.                                                                                                                                                                                                               
      54                 :      *                                                                                                                                                                                                                                                       
      55                 :      * @access public                                                                                                                                                                                                                                        
      56                 :      * @param $treeParentId Die ID unter der der Kurs im Baum erscheinen soll                                                                                                                                                                                
      57                 :      * @return void                                                                                                                                                                                                                                          
      58                 :      */                                                                                                                                                                                                                                                      
      59                 :     function createDialog($treeParentId = 0, $mni = false) {                                                                                                                                                                                                 
      60                 :                                                                                                                                                                                                                                                              
      61               0 :         global $db;                                                                                                                                                                                                                                          
      62               0 :         $teachers = $db->get_results("SELECT ID, ShortName, Vorname, Nachname FROM user WHERE Usergroup=3 ORDER BY Nachname");                                                                                                                               
      63               0 :         if (!$mni) {                                                                                                                                                                                                                                         
      64               0 :             if ($db->num_rows) {                                                                                                                                                                                                                             
      65               0 :                 $this->printHead($treeParentId);                                                                                                                                                                                                             
      66               0 :                 $this->printNameRow();                                                                                                                                                                                                                       
      67               0 :                 $this->printShortNameRow();                                                                                                                                                                                                                  
      68               0 :                 $this->printModulShortCutRow();                                                                                                                                                                                                              
      69               0 :                 $this->printSemesterRow();                                                                                                                                                                                                                   
      70               0 :                 if ($_SESSION['usergroup'] == ADMIN) {                                                                                                                                                                                                       
      71               0 :                     $this->printDozentRow($teachers);                                                                                                                                                                                                        
      72               0 :                 }                                                                                                                                                                                                                                            
      73               0 :                 $this->printFoot();                                                                                                                                                                                                                          
      74               0 :             } else {                                                                                                                                                                                                                                         
      75               0 :                 Output :: errorMessage("Vor dem Anlegen eines Kurses m&uuml;ssen Sie <a href='" . PATH_TO_ROOT . "user/newuser.php'>ein Dozenten-Konto anlegen</a>.", 1, false, true);                                                                       
      76                 :             }                                                                                                                                                                                                                                                
      77               0 :         } else {                                                                                                                                                                                                                                             
      78               0 :             if ($db->num_rows) {                                                                                                                                                                                                                             
      79                 :                 //  $this->printJavaScript();                                                                                                                                                                                                                
      80               0 :                 $this->printHead($treeParentId);                                                                                                                                                                                                             
      81               0 :                 $this->printMNIParameter();                                                                                                                                                                                                                  
      82               0 :                 $this->printNameRow();                                                                                                                                                                                                                       
      83               0 :                 $this->printShortNameRow($mni = true);                                                                                                                                                                                                       
      84               0 :                 self::printModulShortCutSelectRow();                                                                                                                                                                                                         
      85               0 :                 self::printModulTitelSelectRow();                                                                                                                                                                                                            
      86               0 :                 $this->printSemesterRow();                                                                                                                                                                                                                   
      87               0 :                 if ($_SESSION['usergroup'] == ADMIN) {                                                                                                                                                                                                       
      88               0 :                     $this->printDozentRow($teachers);                                                                                                                                                                                                        
      89               0 :                 }                                                                                                                                                                                                                                            
      90               0 :                 $this->printFoot();                                                                                                                                                                                                                          
      91               0 :             } else {                                                                                                                                                                                                                                         
      92               0 :                 Output :: errorMessage("Vor dem Anlegen eines Kurses m&uuml;ssen Sie <a href='" . PATH_TO_ROOT . "user/newuser.php'>ein Dozenten-Konto anlegen</a>.", 1, false, true);                                                                       
      93                 :             }                                                                                                                                                                                                                                                
      94                 :         }                                                                                                                                                                                                                                                    
      95               0 :     }                                                                                                                                                                                                                                                        
      96                 :                                                                                                                                                                                                                                                              
      97                 :     /**                                                                                                                                                                                                                                                      
      98                 :      * Gibt die Kopfelemente aus.                                                                                                                                                                                                                            
      99                 :      *                                                                                                                                                                                                                                                       
     100                 :      * @access private                                                                                                                                                                                                                                       
     101                 :      * @return void                                                                                                                                                                                                                                          
     102                 :      */                                                                                                                                                                                                                                                      
     103                 :     function printHead($treeParentId = 0) {                                                                                                                                                                                                                  
     104                 :         echo "<form action='createcourse.php' method='post'>" .                                                                                                                                                                                              
     105               0 :         "<input type='hidden' name='treeparentid' value='" . $treeParentId . "' />" .                                                                                                                                                                        
     106               0 :         "<table class='contentTable' border='0' cellpadding='0' cellspacing='0'>" .                                                                                                                                                                          
     107               0 :         "<tr>" .                                                                                                                                                                                                                                             
     108               0 :         "<td class='tableHead' colspan='3'>Neuer Kurs</td>" .                                                                                                                                                                                                
     109               0 :         "</tr>";                                                                                                                                                                                                                                             
     110               0 :     }                                                                                                                                                                                                                                                        
     111                 :                                                                                                                                                                                                                                                              
     112                 :     /**                                                                                                                                                                                                                                                      
     113                 :      * Gibt Zeile mit Eingabemoeglichkeit fuer Veranstaltungsnamen aus.                                                                                                                                                                                      
     114                 :      *                                                                                                                                                                                                                                                       
     115                 :      * @access private                                                                                                                                                                                                                                       
     116                 :      * @return void                                                                                                                                                                                                                                          
     117                 :      */                                                                                                                                                                                                                                                      
     118                 :     function printNameRow() {                                                                                                                                                                                                                                
     119                 :         echo "<tr>" .                                                                                                                                                                                                                                        
     120               0 :         "<td class='tableCell'>Name</td>" .                                                                                                                                                                                                                  
     121               0 :         "<td class='tableCell'><p class='pForm'><input type='text' size='50' maxlength='120' name='coursename' " . (isset ($_POST["coursename"]) ? 'value="' . Data :: toHTML($_POST["coursename"]) . '" ' : "") . "/></p></td>" .                           
     122               0 :         "<td class='tableCell'>";                                                                                                                                                                                                                            
     123               0 :         Utilities :: help(50);                                                                                                                                                                                                                               
     124                 :         echo "</td>" .                                                                                                                                                                                                                                       
     125               0 :         "</tr>";                                                                                                                                                                                                                                             
     126               0 :     }                                                                                                                                                                                                                                                        
     127                 :                                                                                                                                                                                                                                                              
     128                 :     /**                                                                                                                                                                                                                                                      
     129                 :      * Gibt Zeile mit Eingabemoeglichkeit fuer Veranstaltungskurznamen aus.                                                                                                                                                                                  
     130                 :      *                                                                                                                                                                                                                                                       
     131                 :      * @access private                                                                                                                                                                                                                                       
     132                 :      * @return void                                                                                                                                                                                                                                          
     133                 :      */                                                                                                                                                                                                                                                      
     134                 :     function printShortNameRow($mni = false) {                                                                                                                                                                                                               
     135                 :         // Kurzname wird aktuell *immer* angezeigt, Parameter $mni daher momentan ohne Wirkung                                                                                                                                                               
     136                 :                                                                                                                                                                                                                                                              
     137                 :             echo "<tr>" .                                                                                                                                                                                                                                    
     138               0 :             "<td class='tableCell'>Kurzname</td>" .                                                                                                                                                                                                          
     139               0 :             "<td class='tableCell'><p class='pForm'><input type='text' size='30' maxlength='10' name='courseshortname' " . (isset ($_POST["courseshortname"]) ? 'value="' . Data :: toHTML($_POST["courseshortname"]) . '" ' : "") . "/></p></td>" .         
     140               0 :             "<td class='tableCell'>";                                                                                                                                                                                                                        
     141               0 :             Utilities :: help(50);                                                                                                                                                                                                                           
     142                 :             echo "</td>" .                                                                                                                                                                                                                                   
     143               0 :             "</tr>";                                                                                                                                                                                                                                         
     144               0 :     }                                                                                                                                                                                                                                                        
     145                 :                                                                                                                                                                                                                                                              
     146                 :     /**                                                                                                                                                                                                                                                      
     147                 :      * Gibt Zeile mit Eingabemoeglichkeit fuer Modulkürzel aus.                                                                                                                                                                                             
     148                 :      *                                                                                                                                                                                                                                                       
     149                 :      * @access private                                                                                                                                                                                                                                       
     150                 :      * @return void                                                                                                                                                                                                                                          
     151                 :      */                                                                                                                                                                                                                                                      
     152                 :     function printModulShortCutRow() {                                                                                                                                                                                                                       
     153                 :         echo "<tr>"                                                                                                                                                                                                                                          
     154                 :             ."<td class='tableCell'>Modulkürzel</td>"                                                                                                                                                                                                       
     155               0 :             ."<td class='tableCell'><p class='pForm'><input type='text' size='12' maxlength='6' name='modulShortCut' ".(isset($_POST["coursemodulshortcut"]) ? 'value="'.Data::toHTML($_POST["coursemodulshortcut"]).'" ' : "")."/></p></td>"                
     156               0 :             ."<td class='tableCell'>";                                                                                                                                                                                                                       
     157               0 :         Utilities::help(50);                                                                                                                                                                                                                                 
     158                 :         echo "</td>"                                                                                                                                                                                                                                         
     159               0 :             ."</tr>";                                                                                                                                                                                                                                        
     160               0 :     }                                                                                                                                                                                                                                                        
     161                 :                                                                                                                                                                                                                                                              
     162                 :     /**                                                                                                                                                                                                                                                      
     163                 :      * Gibt Zeile mit Auswahlmoeglichkeit fuer Semester aus.                                                                                                                                                                                                 
     164                 :      *                                                                                                                                                                                                                                                       
     165                 :      * @access private                                                                                                                                                                                                                                       
     166                 :      * @return void                                                                                                                                                                                                                                          
     167                 :      */                                                                                                                                                                                                                                                      
     168                 :     function printSemesterRow() {                                                                                                                                                                                                                            
     169                 :         echo "<tr>"                                                                                                                                                                                                                                          
     170                 :             ."<td class='tableCell'>Semester</td>"                                                                                                                                                                                                           
     171               0 :             ."<td class='tableCell'>";                                                                                                                                                                                                                       
     172               0 :         CourseUtil::createSemesterListbox(2, isset($_POST["semester"]) ? $_POST["semester"] : Course::semesterDBtoString(CourseUtil::getCurrentSemester()));                                                                                                 
     173                 :         echo "</td>"                                                                                                                                                                                                                                         
     174               0 :             ."<td class='tableCell'>";                                                                                                                                                                                                                       
     175               0 :         Utilities::help(51);                                                                                                                                                                                                                                 
     176                 :         echo "</td>"                                                                                                                                                                                                                                         
     177               0 :             ."</tr>";                                                                                                                                                                                                                                        
     178               0 :     }                                                                                                                                                                                                                                                        
     179                 :                                                                                                                                                                                                                                                              
     180                 :                                                                                                                                                                                                                                                              
     181                 :     /**                                                                                                                                                                                                                                                      
     182                 :      * Gibt Zeile mit Auswahlmoeglichkeit fuer Dozenten aus.                                                                                                                                                                                                 
     183                 :      *                                                                                                                                                                                                                                                       
     184                 :      * @access private                                                                                                                                                                                                                                       
     185                 :      * @return void                                                                                                                                                                                                                                          
     186                 :      */                                                                                                                                                                                                                                                      
     187                 :     function printDozentRow($teachers) {                                                                                                                                                                                                                     
     188               0 :         global $settings;                                                                                                                                                                                                                                    
     189               0 :         global $db;                                                                                                                                                                                                                                          
     190                 :                                                                                                                                                                                                                                                              
     191                 :         echo "<tr>"                                                                                                                                                                                                                                          
     192                 :             ."<td class='tableCell'>Dozent</td>"                                                                                                                                                                                                             
     193               0 :             ."<td class='tableCell'><select name='dozentID'>";                                                                                                                                                                                               
     194               0 :         foreach($teachers as $teacher) {                                                                                                                                                                                                                     
     195               0 :             echo "<option value='".$teacher->ID."'".(isset($_POST["dozentID"]) && $_POST["dozentID"] == $teacher->ID ? " selected='selected'" : "").">".Data::toHTML($teacher->Nachname.", ".$teacher->Vorname." (".$teacher->ShortName, false).")</option>";
     196               0 :         }                                                                                                                                                                                                                                                    
     197                 :         echo "</select></td>"                                                                                                                                                                                                                                
     198               0 :             ."<td class='tableCell'>";                                                                                                                                                                                                                       
     199               0 :         Utilities::help(56);                                                                                                                                                                                                                                 
     200                 :         echo "</td>"                                                                                                                                                                                                                                         
     201               0 :             ."</tr>";                                                                                                                                                                                                                                        
     202               0 :     }                                                                                                                                                                                                                                                        
     203                 :                                                                                                                                                                                                                                                              
     204                 :                                                                                                                                                                                                                                                              
     205                 :     /**                                                                                                                                                                                                                                                      
     206                 :      * Gibt die Fusselemente aus.                                                                                                                                                                                                                            
     207                 :      *                                                                                                                                                                                                                                                       
     208                 :      * @access private                                                                                                                                                                                                                                       
     209                 :      * @return void                                                                                                                                                                                                                                          
     210                 :      */                                                                                                                                                                                                                                                      
     211                 :     function printFoot() {                                                                                                                                                                                                                                   
     212                 :         echo "<tr>"                                                                                                                                                                                                                                          
     213                 :             ."<td class='text12' colspan='3' align='center'>"                                                                                                                                                                                                
     214               0 :             ."<hr />"                                                                                                                                                                                                                                        
     215               0 :             ."<p class='pForm'><input type='submit' name='create' value='Anlegen'/></p> "                                                                                                                                                                    
     216               0 :             ."<p class='pForm'><input type='submit' name='cancel' value='Abbrechen'/></p>"                                                                                                                                                                   
     217               0 :             ."</td>"                                                                                                                                                                                                                                         
     218               0 :             ."</tr>"                                                                                                                                                                                                                                         
     219               0 :             ."</table></form>";                                                                                                                                                                                                                              
     220               0 :     }                                                                                                                                                                                                                                                        
     221                 :                                                                                                                                                                                                                                                              
     222                 :     /**                                                                                                                                                                                                                                                      
     223                 :     * Gibt Combobox mit Eingabemoeglichkeit fuer Modulkuerzel aus.                                                                                                                                                                                           
     224                 :     *                                                                                                                                                                                                                                                        
     225                 :     * @access private                                                                                                                                                                                                                                        
     226                 :     * @return void                                                                                                                                                                                                                                           
     227                 :     */                                                                                                                                                                                                                                                       
     228                 :     static function printModulShortCutSelectRow() {                                                                                                                                                                                                          
     229               0 :         global $settings;                                                                                                                                                                                                                                    
     230               0 :         global $db;                                                                                                                                                                                                                                          
     231                 :                                                                                                                                                                                                                                                              
     232               0 :         $xi = new XmlImport();                                                                                                                                                                                                                               
     233               0 :         $moduls = array ();                                                                                                                                                                                                                                  
     234               0 :         $moduls = $xi->get_latest_modulinfos_from_db();                                                                                                                                                                                                      
     235               0 :         $LZ = array("\n", "\r", "\t", "\x0B", "\0"); // Fuer das spaetere Ersetzen von Steuerzeichen                                                                                                                                                         
     236                 :                                                                                                                                                                                                                                                              
     237                 :         echo "<tr>" .                                                                                                                                                                                                                                        
     238               0 :         "<td class='tableCell'>Modulkuerzel</td>" .                                                                                                                                                                                                          
     239               0 :         "<td class='tableCell'><select id='modulSC' name='modulShortCut' onchange='onMSCSelectChange()'>\n";                                                                                                                                                 
     240               0 :         foreach ($moduls as $modul) {                                                                                                                                                                                                                        
     241               0 :             $modul->modulkuerzel = str_replace($LZ, '', Data::toHTML($modul->modulkuerzel)); // Steuerzeichen werden ersetzt (bzw. entfernt)                                                                                                                 
     242               0 :             echo "<option value='$modul->modulkuerzel'>" . $modul->modulkuerzel  . "</option>\n";                                                                                                                                                            
     243               0 :         }                                                                                                                                                                                                                                                    
     244                 :         echo "</select></td>" .                                                                                                                                                                                                                              
     245               0 :         "<td class='tableCell'>";                                                                                                                                                                                                                            
     246               0 :         Utilities :: help(56);                                                                                                                                                                                                                               
     247                 :         echo "</td>" .                                                                                                                                                                                                                                       
     248               0 :         "</tr>";                                                                                                                                                                                                                                             
     249               0 :     }                                                                                                                                                                                                                                                        
     250                 :                                                                                                                                                                                                                                                              
     251                 :     static function printModulTitelSelectRow() {                                                                                                                                                                                                             
     252               0 :         global $settings;                                                                                                                                                                                                                                    
     253               0 :         global $db;                                                                                                                                                                                                                                          
     254                 :                                                                                                                                                                                                                                                              
     255               0 :         $xi = new XmlImport();                                                                                                                                                                                                                               
     256               0 :         $moduls = array ();                                                                                                                                                                                                                                  
     257               0 :         $moduls = $xi->get_latest_modulinfos_from_db();                                                                                                                                                                                                      
     258               0 :         $LZ = array("\n", "\r", "\t", "\x0B", "\0");    // Fuer das spaetere Ersetzen von Steuerzeichen                                                                                                                                                      
     259                 :         /* Fuer das Ersetzen von Umlauten */                                                                                                                                                                                                                 
     260               0 :         $umlaut = array("ä", "ö", "ü", "ß");                                                                                                                                                                                                             
     261               0 :         $ersatz_umlaut = array("ae", "oe", "ue", "ss");                                                                                                                                                                                                      
     262                 :                                                                                                                                                                                                                                                              
     263                 :         echo "<tr>" .                                                                                                                                                                                                                                        
     264               0 :         "<td class='tableCell'>Modultitel</td>" .                                                                                                                                                                                                            
     265               0 :         "<td class='tableCell'><select id='modultitle' name='modulTitle' onchange='onMTSelectChange()'>\n";                                                                                                                                                  
     266                 :                                                                                                                                                                                                                                                              
     267               0 :         foreach ($moduls as $modul) {                                                                                                                                                                                                                        
     268               0 :             $modul->modultitel = str_replace($LZ, '', $modul->modultitel); // Sonderzeichen werden ersetzt (bzw. entfernt)                                                                                                                                   
     269               0 :             $MT_mit_umlaute = Data::toHTML($modul->modultitel);            // Modultiel mit Umlauten                                                                                                                                                         
     270               0 :             $MT_ohne_umlaute = Data::toHTML(str_replace($umlaut, $ersatz_umlaut, $modul->modultitel)); // Modultitel ohne Umlaue (wird beim spaeteren Vergleich verwendet)                                                                                   
     271               0 :             echo "<option value='$MT_ohne_umlaute'>" . $MT_mit_umlaute . "</option>\n";                                                                                                                                                                      
     272               0 :         }                                                                                                                                                                                                                                                    
     273                 :         echo "</select></td>" .                                                                                                                                                                                                                              
     274               0 :         "<td class='tableCell'>";                                                                                                                                                                                                                            
     275               0 :         Utilities :: help(56);                                                                                                                                                                                                                               
     276                 :         echo "</td>" .                                                                                                                                                                                                                                       
     277               0 :         "</tr>";                                                                                                                                                                                                                                             
     278               0 :     }                                                                                                                                                                                                                                                        
     279                 :                                                                                                                                                                                                                                                              
     280                 :     function printMNIParameter() {                                                                                                                                                                                                                           
     281               0 :         echo "<tr><td class='tableCell'><p class='pForm'><input type='hidden' size='30' maxlength='10' name='mni' value='true'/></p></td></tr>";                                                                                                             
     282               0 :     }                                                                                                                                                                                                                                                        
     283                 :                                                                                                                                                                                                                                                              
     284                 :     static function getJavaScript() {                                                                                                                                                                                                                        
     285               0 :         $js = "";                                                                                                                                                                                                                                            
     286               0 :         $xi = new XmlImport();                                                                                                                                                                                                                               
     287               0 :         $moduls = array ();                                                                                                                                                                                                                                  
     288               0 :         $moduls = $xi->get_latest_modulinfos_from_db();                                                                                                                                                                                                      
     289                 :         /* Fuer das Ersetzen von Umlauten */                                                                                                                                                                                                                 
     290               0 :         $LZ = array("\n", "\r", "\t", "\x0B", "\0");  // Fuer das spaetere Ersetzen von Steuerzeichen                                                                                                                                                        
     291               0 :         $umlaut = array("ä", "ö", "ü", "ß");                                                                                                                                                                                                             
     292               0 :         $ersatz_umlaut = array("ae", "oe", "ue", "ss");                                                                                                                                                                                                      
     293                 :                                                                                                                                                                                                                                                              
     294               0 :         $js .= "var moduls = new Array(" . count($moduls) . ");\n";                                                                                                                                                                                          
     295               0 :         $i = 0;                                                                                                                                                                                                                                              
     296               0 :         foreach ($moduls as $modul) {                                                                                                                                                                                                                        
     297               0 :             $js .= "moduls[$i] = new Array(2);\n"; //2-dimensionales Array anlegen fuer Modulkuerzel + Modultitel                                                                                                                                            
     298                 :                                                                                                                                                                                                                                                              
     299               0 :             $MT_ohne_umlaute = Data::toHTML(str_replace($umlaut, $ersatz_umlaut, $modul->modultitel)); // Modultitel ohne Umlaute (wird beim spaeteren Vergelich verwendet)                                                                                  
     300                 :                                                                                                                                                                                                                                                              
     301               0 :             $js .= "moduls[$i][0] = '".str_replace($LZ, '', Data::toHTML($modul->modulkuerzel))."';\n";  // Sonderzeichen werden ersetzt (bzw. entfernt)                                                                                                     
     302               0 :             $js .= "moduls[$i][1] = '".str_replace($LZ, '', $MT_ohne_umlaute)."';\n";                    // Sonderzeichen werden ersetzt (bzw. entfernt)                                                                                                     
     303               0 :             $i++;                                                                                                                                                                                                                                            
     304               0 :         }                                                                                                                                                                                                                                                    
     305               0 :         $js .= "function onMSCSelectChange()\n";                                                                                                                                                                                                             
     306               0 :         $js .= "{\n";                                                                                                                                                                                                                                        
     307               0 :         $js .= "var modulShortCut=document.getElementById(\"modulSC\");\n";                                                                                                                                                                                  
     308               0 :         $js .= "var modulTitle=document.getElementById(\"modultitle\");\n";                                                                                                                                                                                  
     309               0 :         $js .= "   modulTitle.value = getModultitelbyModulkuerzel(modulShortCut.value);\n";                                                                                                                                                                  
     310               0 :         $js .= "}\n";                                                                                                                                                                                                                                        
     311                 :                                                                                                                                                                                                                                                              
     312               0 :         $js .= "function onMTSelectChange()\n";                                                                                                                                                                                                              
     313               0 :         $js .= "{\n";                                                                                                                                                                                                                                        
     314               0 :         $js .= "var modulShortCut=document.getElementById(\"modulSC\");\n";                                                                                                                                                                                  
     315               0 :         $js .= "var modulTitle=document.getElementById(\"modultitle\");\n";                                                                                                                                                                                  
     316               0 :         $js .= "   modulShortCut.value = getModulkuerzelbyModultitel(modulTitle.value);\n";                                                                                                                                                                  
     317               0 :         $js .= "}\n";                                                                                                                                                                                                                                        
     318                 :                                                                                                                                                                                                                                                              
     319               0 :         $js .= "function getModultitelbyModulkuerzel(modulkuerzel){\n";                                                                                                                                                                                      
     320               0 :         $js .= "       for(var key in moduls)\n";                                                                                                                                                                                                            
     321               0 :         $js .= "            if (modulkuerzel == moduls[key][0])\n";                                                                                                                                                                                          
     322               0 :         $js .= "               return moduls[key][1];\n";                                                                                                                                                                                                    
     323               0 :         $js .= "}\n";                                                                                                                                                                                                                                        
     324                 :                                                                                                                                                                                                                                                              
     325               0 :         $js .= "function getModulkuerzelbyModultitel(modultitel){\n";                                                                                                                                                                                        
     326               0 :         $js .= "       for(var key in moduls)\n";                                                                                                                                                                                                            
     327               0 :         $js .= "            if (modultitel == moduls[key][1])\n";                                                                                                                                                                                            
     328               0 :         $js .= "               return moduls[key][0];\n";                                                                                                                                                                                                    
     329               0 :         $js .= "}\n";                                                                                                                                                                                                                                        
     330                 :                                                                                                                                                                                                                                                              
     331               0 :         return $js;                                                                                                                                                                                                                                          
     332                 :                                                                                                                                                                                                                                                              
     333                 :     }                                                                                                                                                                                                                                                        
     334                 :                                                                                                                                                                                                                                                              
     335                 :     static function printJavaScript() {                                                                                                                                                                                                                      
     336               0 :         echo "<script type=\"text/javascript\">\n";                                                                                                                                                                                                          
     337               0 :         echo self::getJavaScript();                                                                                                                                                                                                                          
     338               0 :         echo " </script>\n";                                                                                                                                                                                                                                 
     339                 :                                                                                                                                                                                                                                                              
     340               0 :     }                                                                                                                                                                                                                                                        
     341                 :                                                                                                                                                                                                                                                              
     342                 : }                                                                                                                                                                                                                                                            
     343                 :                                                                                                                                                                                                                                                              
     344                 :                                                                                                                                                                                                                                                              

Generated by PHPUnit 3.2.21 and Xdebug 2.0.4 at Sat Nov 7 22:04:08 CET 2009.